<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
    'as' => config('admin.route.prefix') . '.',
], function (Router $router) {
    $router->get('/', 'HomeController@index')->name('home');

    $router->resource('areas', AreaController::class);

    $router->resource('keywords', Keyword\KeywordController::class);
    $router->resource('derivative-keywords', Keyword\DerivativeKeywordController::class);

    $router->resource('modules', ModuleController::class);
    $router->resource('module-types', ModuleTypeController::class);

    $router->resource('module.classifies', ClassifyController::class);

    $router->resource('module.infos', InfoController::class);
    $router->resource('delay-task-infos', DelayTaskController::class);

    $router->resource('banner-groups', BannerGroupController::class);

    $router->resource('sections', SectionController::class);

    $router->resource('debris', DebrisController::class);

    $router->resource('msg-forms', MsgFormController::class);
    $router->resource('msgs', MsgController::class);

    $router->resource('blogrolls', BlogrollController::class);

    $router->resource('chat-records', ChatRecordController::class);

    $router->get('tools/clear-page-cache', 'ToolController@clearPageCache')->name('tools.clear_page_cache');
    $router->get('tools/clear-cache-data', 'ToolController@clearCacheData')->name('tools.clear_cache_data');
    $router->get('tools/clear-logs', 'ToolController@clearLogs')->name('tools.clear_logs');
    $router->get('tools/clear-views', 'ToolController@clearViews')->name('tools.clear_views');
    $router->get('tools/clear-dirty-data', 'ToolController@clearDirtyData')->name('tools.clear_dirty_data');
    $router->get('tools/clear-uv-record', 'ToolController@clearUvRecord')->name('tools.clear_uv_record');
});
